<?

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache");
header("Pragma: no-cache");

global $wpdb;

$auth = $_GET['auth'];
$rsSelect = $wpdb->get_results("select * from wp_cliente_auth where auth = '$auth'", ARRAY_A);

$id = $rsSelect[0]['id'];

if ($id) {
	//$wpdb->query("delete from wp_cliente_auth where id = '$id'");
	$wpdb->query("update wp_cliente set status = '1' where id = '$id'");
	setcookie('id', $id, time() + 60 * 60 * 24 * 30, '/');
	$_SESSION['id'] = $id;
	header("location: /");
}